﻿#region Copyright information
// 
// Copyright © 2005-2013 Yongkee Cho. All rights reserved.
// 
// This code is a part of the Biological Object Library and governed under the terms of the
// GNU Lesser General  Public License (LGPL) version 2.1 which accompanies this distribution.
// For more information on the LGPL, please visit http://bol.codeplex.com/license.
// 
// - Filename: ITreeNode.cs
// - Author: Yongkee Cho
// - Email: yongkeecho@gmail.com
// - Date Created: 2013-01-24 4:34 PM
// - Last Modified: 2013-01-25 3:59 PM
// 
#endregion
using System;
using System.Collections.Generic;

namespace BOL.Algorithms.Tree
{
    public interface ITreeNode<T> : ICloneable, IEquatable<ITreeNode<T>> 
    {
        T Value { get; set; }

        bool IsRoot { get; }
        bool IsLeaf { get; }
        ITreeNode<T> Parent { get; set; }
        IList<ITreeNode<T>> Children { get; set; }
        int ChildCount { get; }
        int Depth { get; }

        ITreeNode<T> ChildAt(int index);
        void Add(ITreeNode<T> child);
        bool ContainsChild(ITreeNode<T> child);
        void Insert(int index, ITreeNode<T> child);
        void RemoveAt(int index);
        void Remove(ITreeNode<T> child);
        void RemoveFromParent();
    }
}
